package com.futu.scenicspot.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.futu.common.annotation.NoLoginRequired;
import com.futu.common.vo.ResultVo;
import com.futu.scenicspot.domain.HScenicSpot;
import com.futu.scenicspot.dto.SoptDto;
import com.futu.scenicspot.service.HScenicSpotService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("stop")
public class StopController {
    @Resource
    private HScenicSpotService stopService;

    @RequestMapping("/seldetails")
    @NoLoginRequired
    public ResultVo<HScenicSpot> seldetails(@RequestBody SoptDto dto){
        System.out.println("收到景点详情请求，ID: " + dto.getId());
        
        try {
            return stopService.selall(dto.getId());
        } catch (Exception e) {
            System.err.println("景点详情查询失败: " + e.getMessage());
            e.printStackTrace();
            return ResultVo.error("查询景点详情失败: " + e.getMessage());
        }
    }
}
